package com.xm.interview;

/**
 * @Author：xm
 * @Project：runoob
 * @Date：2024/11/8 23:56
 */

public class _01_User {
    private String name;
    private Integer age;
    private Integer gender;

    public _01_User() {
    }

    public _01_User(String name, Integer age, Integer gender) {
        this.name = name;
        this.age = age;
        this.gender = gender;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    // @Override
    // public boolean equals(Object o) {
    //     if (this == o) return true;
    //     if (o == null || getClass() != o.getClass()) return false;
    //     User01 user01 = (User01) o;
    //     return Objects.equals(name, user01.name) && Objects.equals(age, user01.age) && Objects.equals(gender, user01.gender);
    // }

    /*
    @Override
    public int hashCode() {
        return Objects.hash(name, age, gender);
    }*/

    @Override
    public int hashCode() {
        String str=name+age+gender;
        str.intern();
        return str.hashCode();
    }
}
